"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _jsxRuntime = require("react/jsx-runtime");

var _antdV = require("antd-v4");

var _classnames = _interopRequireDefault(require("classnames"));

var _react = require("react");

var _Card = _interopRequireDefault(require("../Card"));

require("./index.less");

var _excluded = ["key", "tab", "tabKey", "disabled", "destroyInactiveTabPane", "children", "className", "style", "cardProps"];

var TabPane = function TabPane(props) {
  var key = props.key,
      tab = props.tab,
      tabKey = props.tabKey,
      disabled = props.disabled,
      destroyInactiveTabPane = props.destroyInactiveTabPane,
      children = props.children,
      className = props.className,
      style = props.style,
      cardProps = props.cardProps,
      rest = (0, _objectWithoutProperties2.default)(props, _excluded);

  var _useContext = (0, _react.useContext)(_antdV.ConfigProvider.ConfigContext),
      getPrefixCls = _useContext.getPrefixCls;

  var prefixCls = getPrefixCls('pro-card-tabpane');
  var tabPaneClassName = (0, _classnames.default)(prefixCls, className);
  return (0, _jsxRuntime.jsx)(_antdV.Tabs.TabPane, (0, _objectSpread2.default)((0, _objectSpread2.default)({
    tabKey: tabKey,
    tab: tab,
    className: tabPaneClassName,
    style: style,
    disabled: disabled,
    destroyInactiveTabPane: destroyInactiveTabPane
  }, rest), {}, {
    children: (0, _jsxRuntime.jsx)(_Card.default, (0, _objectSpread2.default)((0, _objectSpread2.default)({}, cardProps), {}, {
      children: children
    }))
  }), key);
};

var _default = TabPane;
exports.default = _default;